package metrics_sql

const (
	GluenetsContainerLogsCounts = `
guid = "%v"
container = "%v"

from(bucket: "data")
  |> range(start: %v, stop: %v)
  |> filter(fn: (r) => r["_measurement"] == "logs")
  |> filter(fn: (r) => r["platform"] == "gluenets")
  |> filter(fn: (r) => r["application_guid"] == guid)
  |> filter(fn: (r) => r["container"] == container)
  |> map(fn: (r) => ({_field:"logs",_value:r._value,_time:r._time,level:r["level"]}))
  |> window(every: %v)
  |> count()
`

	GluenetsContainerLogsInfo = `
guid = "%v"
container = "%v"

from(bucket: "data")
  |> range(start: %v, stop: %v)
  |> filter(fn: (r) => r["_measurement"] == "logs")
  |> filter(fn: (r) => r["platform"] == "gluenets")
  |> filter(fn: (r) => r["application_guid"] == guid)
  |> filter(fn: (r) => r["container"] == container)
  |> map(fn: (r) => ({_field:"logs",_value:r._value,_time:r._time,level:r["level"]}))
`
	K8sContainerLogsCounts = `
guid = "%v"
container = "%v"

from(bucket: "data")
  |> range(start: %v, stop: %v)
  |> filter(fn: (r) => r["_measurement"] == "logs")
  |> filter(fn: (r) => r["platform"] == "kubernetes")
  |> filter(fn: (r) => r["application_guid"] == guid)
  |> filter(fn: (r) => r["container"] == container)
  |> map(fn: (r) => ({_field:"logs",_value:r._value,_time:r._time,level:r["level"]}))
  |> window(every: %v)
  |> count()
`
	K8sContainerLogsInfo = `
guid = "%v"
container = "%v"

from(bucket: "data")
  |> range(start: %v, stop: %v)
  |> filter(fn: (r) => r["_measurement"] == "logs")
  |> filter(fn: (r) => r["platform"] == "kubernetes")
  |> filter(fn: (r) => r["application_guid"] == guid)
  |> filter(fn: (r) => r["container"] == container)
  |> map(fn: (r) => ({_field:"logs",_value:r._value,_time: r._time,level:r["level"]}))
`
)
